home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group99a.txt
/
000026_icon-group-sender _Tue Feb 9 08:53:24 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA27464
for icon-group-addresses; Tue, 9 Feb 1999 08:50:52 -0700 (MST)
Message-Id: <199902091550.IAA27464@baskerville.CS.Arizona.EDU>
To: icon-group@optima.CS.Arizona.EDU
Date: 08 Feb 1999 19:11:44 -0500
From: clayton@jazz.cc.gatech.edu (R. Clayton)
Subject: Calling C functions under Solaris.
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
I'd like to call some C functions from with an Icon program under Solaris, and
I'm having a little trouble. First, here's what I'm doing and what I'd like to
have happen (I don't care that the error number is the wrong one):
ja uname -a
SunOS jazz 4.1.3 1 sun4m
ja cat ps.c
#include "rt.h"
int printstring(argc, argv)
int argc;
struct descrip * argv;
{char str[MaxCvtLen];
if (qtos(argv[1], str) == Error) return 101;
printf("printstring parameter is \"%s\".\n", str);
return 0;
}
ja cat ps.icn
procedure main()
local printstring
printstring := loadfunc("./ps.so", "printstring") |
stop("Couldn't load printstring().")
printstring("Hello world!")
end # main
ja make
cc -I/usr/local/icon-9.3/src/h -I/usr/openwin/include -c ps.c -o ps.o
ld -o ps.so ps.o
icont -u ps.icn
Translating:
ps.icn:
main
No errors
Linking:
ja ./ps
printstring parameter is "Hello world!".
ja
So everything works under SunOS. Here's Solaris:
ma uname -a
SunOS mayzie 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-2
ma rm *o
ma make
cc -I/usr/local/icon-9.3/src/h -I/usr/openwin/include -c ps.c -o ps.o
"/usr/local/icon-9.3/src/h/../h/config.h", line 424: warning: macro
replacement within a string literal
cc -G -K pic -o ps.so ps.o
icont -u ps.icn
Translating:
ps.icn:
main
No errors
Linking:
ma ./ps
loadfunc("./ps.so","printstring"): ld.so.1: /usr/local/public/bin/iconx:
fatal: relocation error: file ./ps.so: symbol qtos: referenced symbol not
found
Run-time error 216
File ps.icn; Line 5
external function not found
Traceback:
main()
loadfunc("./ps.so\x00","printstring\x00") from line 5 in ps.icn
ma
I'm thinking I'm missing an Icon library under Solaris, but I can't find one in
the source tree or the executable directories.
And while I have your attention: does anybody know if there are C-callable
routines for creating and manipulating Icon lists? Eventually I'm going to
want to write some C routines that return a list of strings.